<?php
// +----------------------------------------------------------------------------------------------+
// | Projekt       Lepa                                                                           |
// | Dateiname     topDownloads.mod.inc.php                                                       |
// | Plattform     PHP 5.1 / Apache 2.0                                                           |
// |                                                                                              |
// | Autor         Daniel Brun     (dbru)                                                         |
// | Datum         12.03.2009                                                                     |
// |                                                                                              |
// | Beschreibung  Zeigt die Dokumente mit den meisten Downloads an.                              |
// |                                                                                              |
// | Version  Datum       Beschreibung                                                  Autor     |
// | -------  ----------  ------------                                                  -----     |
// | V1.00    2009-03-12  erstellt                                                      dbru      |
// | V2.00    2009-06-18  fertig gestellt                                               dbru      |
// |                                                                                              |
// +----------------------------------------------------------------------------------------------+

$result = DBSelect("*","lp_doc_document"," docCatID != 4 ","ORDER BY downloads DESC LIMIT 5");
$output .= "<div id='top_downloaded_box'>\n
<div id='download_head'></div>\n
<div id='boxes_content'>\n
<font face='Verdana' color='#878787'>\n";
$counter = 1;
$output .= "<table width='185'>\n";
while(($row = mysql_fetch_object($result))){
	if(strlen($row->docName) > 48){
		$docname = substr($row->docName,0,48)."...";
	} else {
		$docname = $row->docName;
	}
	$output .= "<tr valign='top'><td colspan='3'>\n
		<a href='".$_SERVER['PHP_SELF']."?site=documentPage&docID={$row->docID}'><font style='color: #6a6a6a; font-weight: bold;'><img src='img/pfeil2.png' border='' /> $docname</font></a>\n
	</td></tr>\n
	<tr style='font-size: 0.9em;' valign='top'><td height='18'>\n
		Heruntergeladen: <b>$row->downloads</b>\n
	</td><td align='right' height='18'>\n".convertDate($row->date, "d.m.y")."</td></tr>\n";
	$counter++;
}
$output .= "</table>\n
</font>\n
</div>\n
<div id='boxes_bottom'></div>\n
</div>\n";
?>